<template>
  <q-layout>
    <q-btn @click='downLoad'>下载</q-btn>
  </q-layout>
</template>

<script>
import { exportReport } from './json2excel'
import { defineComponent } from 'vue';

export default defineComponent({
  name: 'Sample',
  setup() {
    return {
      downLoad : () => {
        const param = {
          "codeRelVO" : {
            "entityCode":"301",
            "entityType":"01",
            "length":999,
            "isRoot":"0",
            "chainHead":"0",
            "entityNo":"30101000202111290000002"
          },
          "chains" : [
            {
              "relationNode": {
                "id": "eab87047479a4becb50cdb3f6e226163",
                "chainHead": "301011110000042",
                "entityCode": "301",
                "codeName": "产品",
                "entityType": "01",
                "typeName": "产品系列",
                "entityNo": "30101000202111290000002",
                "propertyCode": "111",
                "propertyCodeName": "服务期限",
                "codeValue": "1110000037",
                "codeValueName": "5年、10万公里",
                "chainTail": "301011110000043",
                "gmtCreate": "2021-11-29T06:12:28.000+00:00",
                "gmtModify": "2021-11-29T06:12:28.000+00:00"
              },
              "data": {
                "uuid": "2c19d4366e13401fa1ca45d4f6e37d29",
                "serveAgingCode": "1110000037",
                "agingName": "5年、10万公里",
                "remark": "2",
                "status": "0",
                "companyId": "796e486b",
                "createUserUuid": null,
                "createDate": "2021-11-28T16:00:00.000+00:00",
                "modiUserUuid": null,
                "modiDate": "2021-11-28T16:00:00.000+00:00"
              },
              "info": "服务期限名称：5年、10万公里"
            },
            {
              "relationNode": {
                "id": "8415a9bcd0f546b9ba0309f71fc92025",
                "chainHead": "301011900000069",
                "entityCode": "301",
                "codeName": "产品",
                "entityType": "01",
                "typeName": "产品系列",
                "entityNo": "30101000202111290000002",
                "propertyCode": "190",
                "propertyCodeName": "规则因子",
                "codeValue": "1900000047",
                "codeValueName": null,
                "chainTail": "301011900000070",
                "gmtCreate": "2021-11-29T07:39:03.000+00:00",
                "gmtModify": "2021-11-29T07:39:03.000+00:00"
              },
              "data": {
                "uuid": "00f8abdc0df845f8a07029ac0d8d989e",
                "codeValue": "1900000047",
                "codeValueName": null,
                "computerFlag": "1",
                "elementValue": 1.24,
                "elementAmt": 99.0,
                "computerType": "02",
                "remark": "2",
                "seriesNo": "30101000202111290000002",
                "seriesName": null,
                "relChainCode": null,
                "relChainName": null,
                "status": "0",
                "propertyCode": "131",
                "propertyCodeName": "赔付限额",
                "companyId": "796e486b",
                "createUserUuid": null,
                "createDate": "2021-11-28T16:00:00.000+00:00",
                "modiUserUuid": null,
                "modiDate": "2021-11-28T16:00:00.000+00:00"
              },
              "info": "属性代码值名称：null，是否参与计算标志：1，因素系数：1.24，因素金额：99.0，elementAmt：02，产品系列名称：null"
            }
          ],
          "addRules": {
            "commission": {
              "clac": "1",
              "name": "佣金价",
              "value": 0.4
            }
          },
          "storeNo": "78fc6e10"
        }

        exportReport(param);
      }
    }
  }
});
</script>

<style scoped>

</style>
